-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[processor/resourcedetection] Add support for host cpuinfo attributes #26533
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
processor/resourcedetection
Resource detection processor
label
Sep 8, 2023
ChrsMark
force-pushed
the
add_host_cpuinfo
branch
3 times, most recently
from
September 11, 2023 08:36
4913134
to
0c02a8e
Compare
ChrsMark
force-pushed
the
add_host_cpuinfo
branch
2 times, most recently
from
September 11, 2023 09:04
fd3794c
to
d84f1e2
Compare
mx-psi
reviewed
Sep 11, 2023
processor/resourcedetectionprocessor/internal/system/internal/metadata/generated_config.go
Outdated
Show resolved
Hide resolved
ChrsMark
force-pushed
the
add_host_cpuinfo
branch
2 times, most recently
from
September 12, 2023 08:07
ca82c2d
to
ecdc295
Compare
mx-psi
reviewed
Sep 12, 2023
mx-psi
reviewed
Sep 12, 2023
mx-psi
reviewed
Sep 12, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor/internal/system
Error: internal/system/system.go:152:20: fmt.Errorf call has arguments but no formatting directives
Error: internal/system/system.go:158:20: fmt.Errorf call has arguments but no formatting directives
ChrsMark
force-pushed
the
add_host_cpuinfo
branch
4 times, most recently
from
September 12, 2023 14:36
d40687c
to
fa7712f
Compare
mx-psi
previously approved these changes
Sep 12, 2023
mx-psi
reviewed
Sep 12, 2023
ChrsMark
force-pushed
the
add_host_cpuinfo
branch
from
September 12, 2023 15:10
fa7712f
to
74ba33f
Compare
**Description:** : Added support for host's cpuinfo attributes as part of the system resourcedetection. This information is retrieved from /proc/cpuinfo. **Link to tracking Issue:** open-telemetry#26532 Signed-off-by: ChrsMark <[email protected]>
Thanks for the reviews @mx-psi ! The leftovers are now addressed and the CI is happy. Feel to free to have another look :). |
mx-psi
approved these changes
Sep 13, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mx-psi
added a commit
that referenced
this pull request
Nov 13, 2023
…odel to string (#29152) **Description:** Add feature gate to change family and CPU model to string, to adapt to open-telemetry/semantic-conventions/issues/495. **Link to tracking Issue:** Fixes #29025 **Testing:** Tested with the sample configuration on #26533.
RoryCrispin
pushed a commit
to ClickHouse/opentelemetry-collector-contrib
that referenced
this pull request
Nov 24, 2023
…odel to string (open-telemetry#29152) **Description:** Add feature gate to change family and CPU model to string, to adapt to open-telemetry/semantic-conventions/issues/495. **Link to tracking Issue:** Fixes open-telemetry#29025 **Testing:** Tested with the sample configuration on open-telemetry#26533.
mx-psi
added a commit
that referenced
this pull request
Nov 30, 2023
…ostCPUModelAndFamilyAsString` to beta (#29462) **Description:** Follow up to #29152. The feature gate has been in alpha for two releases (v0.89.0 and v0.90.0). **Link to tracking Issue:** Relates to #29025 and to open-telemetry/semantic-conventions/issues/495. **Testing:** Tested with the sample configuration on #26533.
mx-psi
pushed a commit
that referenced
this pull request
Feb 29, 2024
…string (#31165) #31136 Description: Add feature gate to change CPU stepping to string, to adapt to open-telemetry/semantic-conventions#664. Link to tracking Issue: Fixes #31136 Testing: Tested with the sample configuration on #26533. ### Logs ```console 2024-02-09T15:18:02.014+0200 info [email protected]/telemetry.go:59 Setting up own telemetry... 2024-02-09T15:18:02.014+0200 info [email protected]/telemetry.go:104 Serving metrics {"address": ":8888", "level": "Basic"} 2024-02-09T15:18:02.015+0200 info [email protected]/service.go:140 Starting otelcontribcol... {"Version": "0.94.0-dev", "NumCPU": 8} 2024-02-09T15:18:02.015+0200 info extensions/extensions.go:34 Starting extensions... 2024-02-09T15:18:02.015+0200 info internal/resourcedetection.go:125 began detecting resource information {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics"} 2024-02-09T15:18:02.015+0200 info system/system.go:209 This attribute changed from int to string. Temporarily switch back to int using the feature gate. {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "attribute": "host.cpu.family", "feature gate": "processor.resourcedetection.hostCPUModelAndFamilyAsString"} 2024-02-09T15:18:02.015+0200 info system/system.go:228 This attribute changed from int to string. Temporarily switch back to int using the feature gate. {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "attribute": "host.cpu.model.id", "feature gate": "processor.resourcedetection.hostCPUModelAndFamilyAsString"} 2024-02-09T15:18:02.015+0200 info system/system.go:245 This attribute changed from int to string. Temporarily switch back to int using the feature gate. {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "attribute": "host.cpu.stepping", "feature gate": "processor.resourcedetection.hostCPUSteppingAsString"} 2024-02-09T15:18:02.015+0200 info internal/resourcedetection.go:139 detected resource information {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "resource": {"host.cpu.cache.l2.size":12288,"host.cpu.family":"6","host.cpu.model.id":"140","host.cpu.model.name":"11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz","host.cpu.stepping":"%!f(int32=1)","host.cpu.vendor.id":"GenuineIntel","host.id":"d6488716404e4ce4854ff0e230944c6d","host.name":"chrismark-ThinkPad-X1-Carbon-Gen-9","os.type":"linux"}} 2024-02-09T15:18:02.016+0200 info [email protected]/service.go:166 Everything is ready. Begin running and processing data. 2024-02-09T15:18:02.016+0200 warn localhostgate/featuregate.go:63 The default endpoints for all servers in components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default. {"feature gate ID": "component.UseLocalHostAsDefaultHost"} ``` ### Sample output ```json {"resourceMetrics":[{"resource":{"attributes":[{"key":"host.name","value":{"stringValue":"chrismark-ThinkPad-X1-Carbon-Gen-9"}},{"key":"os.type","value":{"stringValue":"linux"}},{"key":"host.id","value":{"stringValue":"d6488716404e4ce4854ff0e230944c6d"}},{"key":"host.cpu.vendor.id","value":{"stringValue":"GenuineIntel"}},{"key":"host.cpu.family","value":{"stringValue":"6"}},{"key":"host.cpu.model.id","value":{"stringValue":"140"}},{"key":"host.cpu.model.name","value":{"stringValue":"11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz"}},{"key":"host.cpu.stepping","value":{"stringValue":"%!f(int32=1)"}},{"key":"host.cpu.cache.l2.size","value":{"intValue":"12288"}}]},"scopeMetrics":[{"scope":{"name":"otelcol/hostmetricsreceiver/cpu","version":"0.94.0-dev"},"metrics":[{"name":"system.cpu.time","description":"Total seconds each logical CPU spent on each mode.","unit":"s","sum":{"dataPoints":[{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1273.45},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":174.29},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19845.95},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.95},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":18.22},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":29.94},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1327.97},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":175.68},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19804.5},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.06},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":9.11},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":28.7},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1249.04},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":178.22},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19846.01},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":2.48},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":10.42},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":26.88},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1211.17},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":176.69},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19912.68},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.45},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":4.92},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":28.48},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1254.73},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":179.59},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19869.65},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.11},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":2.92},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":25.91},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1272.94},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":176.64},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19825.63},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.01},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":3.33},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":24.5},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1317.85},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":176.44},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19803.92},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.7},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":3.87},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":32.35},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1238.01},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":198.62},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19849},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.84},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":2.49},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":27.29}],"aggregationTemporality":2,"isMonotonic":true}}]}],"schemaUrl":"https://opentelemetry.io/schemas/1.9.0"}]} ``` cc: @mx-psi Signed-off-by: ChrsMark <[email protected]>
XinRanZhAWS
pushed a commit
to XinRanZhAWS/opentelemetry-collector-contrib
that referenced
this pull request
Mar 13, 2024
…string (open-telemetry#31165) open-telemetry#31136 Description: Add feature gate to change CPU stepping to string, to adapt to open-telemetry/semantic-conventions#664. Link to tracking Issue: Fixes open-telemetry#31136 Testing: Tested with the sample configuration on open-telemetry#26533. ### Logs ```console 2024-02-09T15:18:02.014+0200 info [email protected]/telemetry.go:59 Setting up own telemetry... 2024-02-09T15:18:02.014+0200 info [email protected]/telemetry.go:104 Serving metrics {"address": ":8888", "level": "Basic"} 2024-02-09T15:18:02.015+0200 info [email protected]/service.go:140 Starting otelcontribcol... {"Version": "0.94.0-dev", "NumCPU": 8} 2024-02-09T15:18:02.015+0200 info extensions/extensions.go:34 Starting extensions... 2024-02-09T15:18:02.015+0200 info internal/resourcedetection.go:125 began detecting resource information {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics"} 2024-02-09T15:18:02.015+0200 info system/system.go:209 This attribute changed from int to string. Temporarily switch back to int using the feature gate. {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "attribute": "host.cpu.family", "feature gate": "processor.resourcedetection.hostCPUModelAndFamilyAsString"} 2024-02-09T15:18:02.015+0200 info system/system.go:228 This attribute changed from int to string. Temporarily switch back to int using the feature gate. {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "attribute": "host.cpu.model.id", "feature gate": "processor.resourcedetection.hostCPUModelAndFamilyAsString"} 2024-02-09T15:18:02.015+0200 info system/system.go:245 This attribute changed from int to string. Temporarily switch back to int using the feature gate. {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "attribute": "host.cpu.stepping", "feature gate": "processor.resourcedetection.hostCPUSteppingAsString"} 2024-02-09T15:18:02.015+0200 info internal/resourcedetection.go:139 detected resource information {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "resource": {"host.cpu.cache.l2.size":12288,"host.cpu.family":"6","host.cpu.model.id":"140","host.cpu.model.name":"11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz","host.cpu.stepping":"%!f(int32=1)","host.cpu.vendor.id":"GenuineIntel","host.id":"d6488716404e4ce4854ff0e230944c6d","host.name":"chrismark-ThinkPad-X1-Carbon-Gen-9","os.type":"linux"}} 2024-02-09T15:18:02.016+0200 info [email protected]/service.go:166 Everything is ready. Begin running and processing data. 2024-02-09T15:18:02.016+0200 warn localhostgate/featuregate.go:63 The default endpoints for all servers in components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default. {"feature gate ID": "component.UseLocalHostAsDefaultHost"} ``` ### Sample output ```json {"resourceMetrics":[{"resource":{"attributes":[{"key":"host.name","value":{"stringValue":"chrismark-ThinkPad-X1-Carbon-Gen-9"}},{"key":"os.type","value":{"stringValue":"linux"}},{"key":"host.id","value":{"stringValue":"d6488716404e4ce4854ff0e230944c6d"}},{"key":"host.cpu.vendor.id","value":{"stringValue":"GenuineIntel"}},{"key":"host.cpu.family","value":{"stringValue":"6"}},{"key":"host.cpu.model.id","value":{"stringValue":"140"}},{"key":"host.cpu.model.name","value":{"stringValue":"11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz"}},{"key":"host.cpu.stepping","value":{"stringValue":"%!f(int32=1)"}},{"key":"host.cpu.cache.l2.size","value":{"intValue":"12288"}}]},"scopeMetrics":[{"scope":{"name":"otelcol/hostmetricsreceiver/cpu","version":"0.94.0-dev"},"metrics":[{"name":"system.cpu.time","description":"Total seconds each logical CPU spent on each mode.","unit":"s","sum":{"dataPoints":[{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1273.45},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":174.29},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19845.95},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.95},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":18.22},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu0"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":29.94},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1327.97},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":175.68},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19804.5},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.06},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":9.11},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu1"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":28.7},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1249.04},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":178.22},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19846.01},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":2.48},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":10.42},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu2"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":26.88},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1211.17},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":176.69},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19912.68},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.45},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":4.92},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu3"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":28.48},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1254.73},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":179.59},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19869.65},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.11},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":2.92},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu4"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":25.91},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1272.94},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":176.64},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19825.63},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.01},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":3.33},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu5"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":24.5},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1317.85},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":176.44},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19803.92},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.7},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":3.87},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu6"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":32.35},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"user"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":1238.01},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"system"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":198.62},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"idle"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":19849},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"interrupt"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"nice"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0.84},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"softirq"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":2.49},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"steal"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":0},{"attributes":[{"key":"cpu","value":{"stringValue":"cpu7"}},{"key":"state","value":{"stringValue":"wait"}}],"startTimeUnixNano":"1707463254000000000","timeUnixNano":"1707484683016351289","asDouble":27.29}],"aggregationTemporality":2,"isMonotonic":true}}]}],"schemaUrl":"https://opentelemetry.io/schemas/1.9.0"}]} ``` cc: @mx-psi Signed-off-by: ChrsMark <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description: : Added support for host's cpuinfo attributes
as part of the system resourcedetection. This information
is retrieved from /proc/cpuinfo.
Link to tracking Issue: #26532
Testing:
How to test this manually
./bin/otelcontribcol_linux_amd64 --config examples/host_config.yaml
Unit tests
Documentation: Updated README.md